//: C20:StreamTokenizer.cpp {O}
// From Thinking in C++, 2nd Edition
// Available at http://www.BruceEckel.com
// (c) Bruce Eckel 1999
// Copyright notice in Copyright.txt
#include "StreamTokenizer.h"
using namespace std;

string StreamTokenizer::next()
{
    string result;
    if (p != end) {
        insert_iterator<string>
        ii(result, result.begin());
        while (isDelimiter(*p) && p != end)
            p++;
        while (!isDelimiter(*p) && p != end)
            *ii++ = *p++;
    }
    return result;
} ///:~
